<?php 
    echo validation_errors("<li>", "</li>"); 
    if(isset($error)) {
        echo "<div class='mess_error'>";
        echo    "<ul>";
        echo        "<li>$error</li>";
        echo    "</ul>";
        echo "</div>";
    }
?>
<div id="formerror"></div>
<!-- Add Form -->
<div id="formaction_product_edit">
    <div class="formPanel">
        <fieldset>
            <legend>Thêm sản phẩm</legend>
            <form id="input_form_product_edit" method="post" 
                  action="<?php echo base_url(); ?>admin_combo/product/edit/<?php if(isset($info_edit)) echo $info_edit["pro_id"]; ?>" enctype="multipart/form-data">
                <label>Category</label>
            <select id="slCate" name="slCate">
                <?php
                    if(isset($info_cate))
                        callMenuCate($info_cate, 0, "**", $info_edit["cate_id"]);
                ?>
            </select>
            <br />
            <label>Tiêu Đề </label><input type="text" id="txtTitle" name="txtTitle" size="60" class="required" 
                                          value="<?php if(isset($info_edit)) echo $info_edit["pro_title"]; ?>" /><br />
            <label>Thông Tin </label><input type="text" id="txtInfo" name="txtInfo" size="60" class="required" 
                                          value="<?php if(isset($info_edit)) echo $info_edit["pro_info"]; ?>" /><br />
            <label>Chi Tiết </label><br /><textarea id="txtDetail" name="txtDetail" cols="50" rows="20" class="required">
                                                <?php if(isset($info_edit)) echo $info_edit["pro_detail"]; ?>
                                            </textarea><br />
            <script language="javascript">
                CKEDITOR.replace("txtDetail");
            </script>
            <label>Hình Ảnh </label><input type="file" id="fileImage" name="fileImage" size="60" /><br />
            <input type="hidden" name="txtOldImg" id="txtOldImg" 
                          value="<?php if(isset($info_edit)) echo $info_edit["pro_img"]; ?>" />
            <?php
                if(isset($info_edit["pro_img"])) {
                    echo "<img width='100' height='100' src='".base_url()."uploads/product_main/".$info_edit["pro_img"]."' />";
                }
            ?>
            <br />
            <label>Giá Thành </label><input type="text" id="txtPrice" name="txtPrice" size="30" class="required digits" 
                                            value="<?php if(isset($info_edit)) echo $info_edit["pro_price"]; ?>" /><br />
            <label>Số Lượng </label><input type="text" id="txtQuan" name="txtQuan" size="30" class="required digits" 
                                            value="<?php if(isset($info_edit)) echo $info_edit["pro_quantity"]; ?>" /><br />
            <label>Trạng Thái </label>
            <select id="slStatus" name="slStatus">
                <?php
                    if(isset($info_status))
                        callStatus($info_status);
                ?>
            </select>
            <br />
            <label>&nbsp;</label><input type="submit" id="btnSubmit_product" class="button" name="ok" value="Submit" />
            </form>
        </fieldset>
    </div>
</div>
<div id="dialog" title="Warning"></div>